/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package newpackage;

import clz.DB;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Hishan
 */
public class CreateProcedure {
    public static void Procedurecreator(){
        try {
            Statement statement = DB.getConnection().createStatement();
            String pro="DELIMITER $$"
                    + "DROP PROCEDURE IF EXISTS `kuru`.`seat` $$"
                    + "CREATE PROCEDURE `kuru`.`seat` ()"
                    + "BEGIN"
                    + "select * from images;"
                    + "END $$"
                    + "DELIMITER ;";
            DB.getConnection().createStatement().execute(pro);
//            statement.addBatch("DELIMITER $$");
//            statement.addBatch("DROP PROCEDURE IF EXISTS `kuru`.`idd` $$");
//            statement.addBatch("CREATE PROCEDURE `kuru`.`idd` ()");
//            statement.addBatch("BEGIN");
//            statement.addBatch("SELECT * FROM `kuru`.`subber`;");
//            statement.addBatch("END $$");
//            statement.addBatch("DELIMITER ;");
//            
            
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(CreateProcedure.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(CreateProcedure.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
